/*
 * @Author: ShengXD <1519256482@qq.com>
 * @Date: 2024-11-06 15:15:07
 * @LastEditors: ShengXD <1519256482@qq.com>
 * @LastEditTime: 2024-11-06 15:15:10
 * @FilePath: /vben-quick-setup/apps/backend-mock/api/logout.ts
 * @Description: 
 */
import {
    clearRefreshTokenCookie,
    getRefreshTokenFromCookie,
  } from '~/utils/cookie-utils';
  
  export default defineEventHandler(async (event) => {
    const refreshToken = getRefreshTokenFromCookie(event);
    if (!refreshToken) {
      return useResponseSuccess('');
    }
  
    clearRefreshTokenCookie(event);
  
    return useResponseSuccess('');
  });